package edu.bit.water.controller;

import edu.bit.water.entity.MetaDischargeMaxPermission;
import edu.bit.water.entity.NewWasteWater;
import edu.bit.water.service.NewWasteWaterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("/new_waste_water")
public class newWasteWaterController {
    @Autowired
    private NewWasteWaterService newWasteWaterService;

    @RequestMapping("/select")
    @ResponseBody
    public Map<String, Object> select(int id) {
        Map<String, Object> map = new HashMap<>();
        List<NewWasteWater> list = newWasteWaterService.select(id);
        map.put("rows", list);
        return map;
    }

    @RequestMapping("/meta_data_retrieve")
    @ResponseBody
    public List<MetaDischargeMaxPermission> metaDataRetrieve(String companyType, String scope, String level) {
        List<MetaDischargeMaxPermission> list = newWasteWaterService.metaDataRetrieve(companyType, scope, level);
        return list;
    }
}
